#ifndef _FIG_PICKUP_H_
#define _FIG_PICKUP_H_

#include "ui/ui_manager.h"

class FIGSfx;


class FIGPickup
{
public:

	enum PICKUP_TYPES
	{
		PICKUP_TYPE_NONE,
		PICKUP_TYPE_WEAPON_RED,			// introduce at level - 1 
		PICKUP_TYPE_WEAPON_GREEN,		
		PICKUP_TYPE_WEAPON_BLUE,		
		PICKUP_TYPE_WEAPON_COUNT,

		PICKUP_TYPE_1UP,				// introduce at level - 1
		PICKUP_TYPE_HEALTH,				// introduce at level - 2
		PICKUP_TYPE_STAR,				// introduce at level - 1
		PICKUP_TYPE_SHIELD,				// introduce at level - 3
		PICKUP_TYPE_ROKET_SHOOT,		// introduce at level - 3
		PICKUP_TYPE_NUKE,				// introduce at level - 2

		PICKUP_ORB_RED,					// introduce at level - 1 
		PICKUP_ORB_BLUE,
		PICKUP_ORB_GREEN,

		PICKUP_NUKE_BUTTON,

		PICKUP_COUNT
	};

	enum	PICKUP_STATE
	{
		PICKUP_STATE_NONE,
		PICKUP_STATE_SPAWN_MOVEMENT,
		PICKUP_STATE_CIRCLE_AROUND,
		PICKUP_EATEN_ANIMATION,
		PICKUP_STATE_COUNT

	};
	

	FIGPickup(FIGPickup::PICKUP_TYPES Type, const math::Vec2& P);


	virtual void				Render(const math::Vec2& Offset, float Scale);
	virtual void				RenderDebug(const math::Vec2& Offset, float Scale);
	virtual void				Tick(float dt);
	virtual void				ReSpawn();
	virtual void				RenderShadow(const math::Vec2& Offset, float Scale);

	virtual void				OnDie();
	virtual bool				HitTest(const math::Vec2& P);

	void						Clear();	
	bool						IsAlive() const { return m_IsAlive; }; 	
	const math::Vec2&			GetPos() const  { return m_Pos; };
	float						GetRotation() const { return m_Rotation; };	
	bool						IsInSideScreen();
	
	static PICKUP_TYPES			MapNameToType(const std::string& Name);
	static std::string			MapTypeToName(PICKUP_TYPES Type);

	static std::string			GetSpriteFile1(PICKUP_TYPES Type);
	static std::string			GetSpriteFile2(PICKUP_TYPES Type);
	

protected:          

	void						Tick_States(float dt);
	void						Tick_SpawnMovment(float dt);
	void						Tick_CircleAround(float dt);
	void						Tick_Eaten_Animation(float dt);

	void						HitTest();
	void						LoadSprite();
	void						Load(const std::string& Name,const std::string& Glow);
	void						GotEaten();
	

	math::Counter				m_CircleCounter;
	math::Counter				m_GlowCounter;
	FIGPickup::PICKUP_TYPES		m_Type;


	bool						m_IsAlive;
	math::Vec2					m_Pos;
	math::Vec2					m_Size;	
	math::Vec2					m_GlowSize;	

	ui::UISprite				m_pSprite;	
	float						m_Radius;	
	float						m_Rotation;	
	
	ui::UISprite				m_Sprite;
	ui::UISprite				m_SpriteGlow;

  	PICKUP_STATE				m_State;
	float						m_SpawnMovementDegree;
	float						m_SpawnMovementTime;
	FIGSfx*						m_pSFX;
	float						m_RotationSpeed;

};

#endif